package com.ruoyi.receipt.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.receipt.mapper.ErpMaterialReceiptMapper;
import com.ruoyi.receipt.domain.ErpMaterialReceipt;
import com.ruoyi.receipt.service.IErpMaterialReceiptService;

/**
 * 生产入库Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-22
 */
@Service
public class ErpMaterialReceiptServiceImpl implements IErpMaterialReceiptService 
{
    @Autowired
    private ErpMaterialReceiptMapper erpMaterialReceiptMapper;

    /**
     * 查询生产入库
     * 
     * @param receiptId 生产入库主键
     * @return 生产入库
     */
    @Override
    public ErpMaterialReceipt selectErpMaterialReceiptByReceiptId(Long receiptId)
    {
        return erpMaterialReceiptMapper.selectErpMaterialReceiptByReceiptId(receiptId);
    }

    /**
     * 查询生产入库列表
     * 
     * @param erpMaterialReceipt 生产入库
     * @return 生产入库
     */
    @Override
    public List<ErpMaterialReceipt> selectErpMaterialReceiptList(ErpMaterialReceipt erpMaterialReceipt)
    {
        return erpMaterialReceiptMapper.selectErpMaterialReceiptList(erpMaterialReceipt);
    }

    /**
     * 新增生产入库
     * 
     * @param erpMaterialReceipt 生产入库
     * @return 结果
     */
    @Override
    public int insertErpMaterialReceipt(ErpMaterialReceipt erpMaterialReceipt)
    {
        erpMaterialReceipt.setCreateTime(DateUtils.getNowDate());
        return erpMaterialReceiptMapper.insertErpMaterialReceipt(erpMaterialReceipt);
    }

    /**
     * 修改生产入库
     * 
     * @param erpMaterialReceipt 生产入库
     * @return 结果
     */
    @Override
    public int updateErpMaterialReceipt(ErpMaterialReceipt erpMaterialReceipt)
    {
        return erpMaterialReceiptMapper.updateErpMaterialReceipt(erpMaterialReceipt);
    }

    /**
     * 批量删除生产入库
     * 
     * @param receiptIds 需要删除的生产入库主键
     * @return 结果
     */
    @Override
    public int deleteErpMaterialReceiptByReceiptIds(Long[] receiptIds)
    {
        return erpMaterialReceiptMapper.deleteErpMaterialReceiptByReceiptIds(receiptIds);
    }

    /**
     * 删除生产入库信息
     * 
     * @param receiptId 生产入库主键
     * @return 结果
     */
    @Override
    public int deleteErpMaterialReceiptByReceiptId(Long receiptId)
    {
        return erpMaterialReceiptMapper.deleteErpMaterialReceiptByReceiptId(receiptId);
    }
}
